import express from 'express';
import { getVideos, generateVideoThumbnail, saveVideoMetadata, generateVideo, deleteVideo, upload, uploadAndGenerate, checkVideoStatus } from '../controllers/video.controller';

const router = express.Router();

// 获取视频列表
router.get('/videos', getVideos);

// 生成视频缩略图
router.post('/videos/:videoId/thumbnail', generateVideoThumbnail);

// 保存视频元数据
router.post('/videos/metadata', saveVideoMetadata);

// 生成视频
router.post('/video/generate', generateVideo);

// 检查视频生成状态
router.get('/video/status/:videoId', checkVideoStatus);

// 删除视频
router.delete('/videos/:videoId', deleteVideo);

// 文件上传并生成视频
router.post('/upload-and-generate', upload.single('file'), uploadAndGenerate);

export default router; 